{{include file="header2.html"}}
{{include file="menu2.html"}}
		<div class="web_rigth_main" style="background-color:white">
			<!--网站主体内容 S-->
		

		<div class="content_title_bar">
			<span>&diams;就业信息添加或修改</span>
		</div>
		<form method="post" enctype="multipart/form-data">
			<input type="hidden" name="id" value="{{if $result.id}}{{$result.id}}{{/if}}">					<!--修改数据ID-->
		<table class="content_table">
			<tr>
				<td>已毕业：</td>
				<td>
					<div class="select_div" style="float:left;margin-left:10px;">
					<select name="gra_year">
						<option value='' {{if $result.gra_year == ''}}checked=checked{{/if}}>请选择年份..</option>
						<option value="1">1年</option>
				        <option value="2">2年</option>
				        <option value="3">3年</option>
				        <option value="4">4年</option>
				        <option value="5">5年</option>
				        <option value="6">6年</option>
				        <option value="7">7年</option>
				        <option value="8">8年</option>
				        <option value="9">9年</option>
				        <option value="9">10年</option>
					</select>
					</div>
				</td>
			</tr>
			<tr>
				<td>工资：</td>
				<td><input type="text" name="price" autocomplete="off" value="{{if $result.price}}{{$result.price}}{{/if}}"></td>
			</tr>
			<tr>
				<td>公司名称：</td>
				<td><input type="text" name="company_name" autocomplete="off" value="{{if $result.company_name}}{{$result.company_name}}{{/if}}"></td>
			</tr>
			<tr>
				<td>工作职位：</td>
				<td><input type="text" name="position" autocomplete="off" value="{{if $result.position}}{{$result.position}}{{/if}}"></td>
			</tr>
			<tr>
				<td>工作地点(省份)：</td>
				<td>
					<div class="select_div" style="float:left;margin-left:10px;">
					<select name="province" class="chosen" id="province" style="min-width:150px" sub = 'city' >
						<option value=''>请选择省份..</option>
						{{if province}}
						{{foreach from=$province item=val key=key}}
						<option value="{{$val.province_id}}" {{if $val.province_id == $result.province.0.province_id}}selected="selected"{{/if}}>{{$val.province_name}}</option>
						{{/foreach}}
						{{/if}}
					</select>
					</div>
					<div class="select_div" style="float:left;margin-left:10px;">
					<select name="city" class="chosen" id="city" style="min-width:150px" sub = 'area' data-placeholder='请选择市区..' >
						{{if $result.city}}
						{{foreach from=$city item=val key=key}}
						<option value="{{$val.city_id}}" {{if $val.city_id == $result.city.0.city_id}}selected="selected"{{/if}}>{{$val.city_name}}</option>
						{{/foreach}}
						{{/if}}
					</select>
					</div>
					<div class="select_div" style="float:left;margin-left:10px;">
					<select name="area" class="chosen" id="area" style="min-width:150px" data-placeholder='请选择区域..'>
						{{if $result.area}}
						{{foreach from=$area item=val key=key}}
						<option value="{{$val.area_id}}" {{if $val.area_id == $result.area.0.area_id}}selected="selected"{{/if}}>{{$val.area_name}}</option>
						{{/foreach}}
						{{/if}}
					</select>
					</div>
				</td>
			</tr>
			<tr>
				<td>创业 就业 升学：</td>
				<td>
					<div class="select_div" style="float:left;margin-left:10px;">
				    <select name="type">
				        <option value="0">创业</option>
				        <option value="1">就业</option>
				        <option value="2">升学</option>
				    </select>
				</td>
			</tr>
			<tr>
				<td>公司的融资情况：</td>
				<td>
					<div class="select_div" style="float:left;margin-left:10px;">
				    <select name="company_type">
				        <option value="0">未融资</option>
				        <option value="1">天使轮</option>
				        <option value="2">A轮</option>
				        <option value="3">B轮</option>
				        <option value="4">C轮</option>
				        <option value="5">D轮及以上</option>
				        <option value="6">上市公司</option>
				        <option value="7">不需要融资</option>
				    </select>
				</td>
			</tr>
			<tr>
				<td>工作于专业的相关度：</td>
				<td>
					<div class="select_div" style="float:left;margin-left:10px;">
				    <select name="related">
				        <option value="0">不相关</option>
				        <option value="1">有点相关</option>
				        <option value="2">挺多相关</option>
				        <option value="3">完全相关</option>
				    </select>
				</td>
			</tr>

		</table>
			<input type="button" name="submit" value="确认" style="margin:20px 0 0 280px" onclick="clickinfo()">
		</form>
		</div>
	</div>
<script type="text/javascript">
	//提交
	function clickinfo(){
	    var params = $("form").serialize();
	    $.post('{{"index.php?app=Info&act=addinfo"|URL}}',params,function(result){
	        if(result.statusCode=='200'){
	        	ui.success(result.message);
	        	setTimeout(function(){
					var url = '{{"index.php?app=Info"|URL}}'; 
					document.location.href = url;//登录后跳转页面
	        	},1000);
	        }else if(result.statusCode=='300'){
	        	ui.error(result.message);
	        }	
	    },'json');
	};

	//省——>市
	$("#province").change(function(){
		change(this);
	});

	//市——>区域
	$("#city").change(function(){
		change(this);
	});

	//联动请求
	var change = function(obj){
		var area_id = $(obj).val();
		var area_name = $(obj).attr('name');
		var sub_name = $(obj).attr('sub');
		$("#area").html('').attr("data-placeholder",'请选择区域').trigger("chosen:updated");
		//ajax提交
		if(area_id == ''){
			$("#city").html('').attr("data-placeholder",'请选择市区').trigger("chosen:updated");
		}else{
			$.get('{{"index.php?app=info&act=getAddress"|URL}}',{'area_id':area_id,'area_name':area_name},function(xml){
				if(xml.statusCode == '200'){
					//修改项目后指派字段的更新
					$("#"+sub_name+"").html(xml.message).trigger("chosen:updated");
				}else{
					ui.error(xml.message);
				}
			},'json');
		}
	};
</script>
{{include file="footer2.html"}}